<template>
    <vechart :id="id" :theme="theme" :option="chartoption"></vechart>
</template>

<script>
    import vechart from './vechart.vue'
    import {theme_blue} from './theme-blue';

    export default {
        components: {vechart},
        props: ["id", "chartData"],
        data() {
            return {
                theme: theme_blue,
                chartoption: {
                    tooltip: {
                        trigger: 'axis',
                        axisPointer: {
                            type: 'cross',
                            crossStyle: {
                                color: '#999'
                            }
                        }
                    },
                    xAxis: [
                        {
                            type: 'category',
                            data: ['1月','2月','3月','4月','5月','6月','7月','8月','9月','10月','11月','12月'],
                            axisPointer: {
                                type: 'shadow'
                            }
                        }
                    ],
                    yAxis: [
                        {
                            type: 'value',
                            name: this.chartData.leftname,
                            min: 0,
                            max: 250,
                            interval: 50,
                            axisLabel: {
                                formatter: '{value}'
                            }
                        },
                        {
                            type: 'value',
                            name: this.chartData.rightname,
                            min: 0,
                            max: 25,
                            interval: 5,
                            axisLabel: {
                                formatter: '{value}'
                            }
                        }
                    ],
                    series: this.chartData.data
                }
            }
        },
        mounted() {
        }
    };
</script>
